package com.rtx.edi.platform.structure.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rtx.edi.model.api.po.PlApiMappingStructure;

/**
 * <p>
 * 对接场景表 Mapper 接口
 * </p>
 *
 * @author cafebabe
 * @since 2023-03-18
 */
@Mapper
public interface PlApiMappingStructureMapper extends BaseMapper<PlApiMappingStructure> {

	/**
	 * 逻辑删除
	 * @param id
	 * @return
	 */
	@Update("update pl_api_mapping_structure set is_Deleted ='1' where id =#{id}")
	int updIsdelteFlag(@Param("id")Long id);
	
	/**
	 * 	删除报文映射
	 * @param apiMappingId
	 * @return
	 */
	@Delete("delete from pl_api_mapping_structure  where api_mapping_id = #{apiMappingId}")
	int delStructureByApiMappingId(@Param("apiMappingId")Long apiMappingId);
	
	/**
	 * 查询表字段
	 * @param sql
	 * @return
	 */
	@Select("${sql}")
	List<Map<String,String>> queryTableColums(@Param("sql")String sql);
	
	/**
	 * 执行插入sql
	 * @param sql
	 * @return
	 */
	@Insert("${sql}")
	int insetSql(@Param("sql")String sql);
}
